package com.woniu.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import lombok.Data;

/**
 * 车辆表
 * @TableName vehicle
 */
@TableName(value ="vehicle")
@Data
public class Vehicle implements Serializable {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 客户id
     */
    private Long customerId;

    /**
     * 车牌号
     */
    private String licensePlate;

    /**
     * 车架号
     */
    private String vin;

    /**
     * 品牌类型
     */
    private String brandType;

    /**
     * 车辆类型
     */
    private String vehicleType;

    /**
     * 车辆颜色
     */
    private String vehicleColor;

    /**
     * 电池容量
     */
    private BigDecimal batteryCapacity;

    /**
     * 续航里程
     */
    private Integer rangeKm;

    /**
     * 描述
     */
    private String description;

    /**
     * 状态
     */
    private Integer status;

    /**
     * 车辆图片
     */
    private String vehicleImage;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Vehicle other = (Vehicle) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCustomerId() == null ? other.getCustomerId() == null : this.getCustomerId().equals(other.getCustomerId()))
            && (this.getLicensePlate() == null ? other.getLicensePlate() == null : this.getLicensePlate().equals(other.getLicensePlate()))
            && (this.getVin() == null ? other.getVin() == null : this.getVin().equals(other.getVin()))
            && (this.getBrandType() == null ? other.getBrandType() == null : this.getBrandType().equals(other.getBrandType()))
            && (this.getVehicleType() == null ? other.getVehicleType() == null : this.getVehicleType().equals(other.getVehicleType()))
            && (this.getVehicleColor() == null ? other.getVehicleColor() == null : this.getVehicleColor().equals(other.getVehicleColor()))
            && (this.getBatteryCapacity() == null ? other.getBatteryCapacity() == null : this.getBatteryCapacity().equals(other.getBatteryCapacity()))
            && (this.getRangeKm() == null ? other.getRangeKm() == null : this.getRangeKm().equals(other.getRangeKm()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getVehicleImage() == null ? other.getVehicleImage() == null : this.getVehicleImage().equals(other.getVehicleImage()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCustomerId() == null) ? 0 : getCustomerId().hashCode());
        result = prime * result + ((getLicensePlate() == null) ? 0 : getLicensePlate().hashCode());
        result = prime * result + ((getVin() == null) ? 0 : getVin().hashCode());
        result = prime * result + ((getBrandType() == null) ? 0 : getBrandType().hashCode());
        result = prime * result + ((getVehicleType() == null) ? 0 : getVehicleType().hashCode());
        result = prime * result + ((getVehicleColor() == null) ? 0 : getVehicleColor().hashCode());
        result = prime * result + ((getBatteryCapacity() == null) ? 0 : getBatteryCapacity().hashCode());
        result = prime * result + ((getRangeKm() == null) ? 0 : getRangeKm().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getVehicleImage() == null) ? 0 : getVehicleImage().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", customerId=").append(customerId);
        sb.append(", licensePlate=").append(licensePlate);
        sb.append(", vin=").append(vin);
        sb.append(", brandType=").append(brandType);
        sb.append(", vehicleType=").append(vehicleType);
        sb.append(", vehicleColor=").append(vehicleColor);
        sb.append(", batteryCapacity=").append(batteryCapacity);
        sb.append(", rangeKm=").append(rangeKm);
        sb.append(", description=").append(description);
        sb.append(", status=").append(status);
        sb.append(", vehicleImage=").append(vehicleImage);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}